// JavaScript Document
function $(){return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);}
//运行本地exe文件
function runExe(strPath){
 try{      
  	 var objShell = new ActiveXObject("wscript.shell");      
    	  objShell.Run(strPath);      
   	     objShell = null;      
   }      
  catch(e){   
        alert('找不到文件"'+strPath+'"(或它的组件之一)。请确定路径和文件名是否正确.')      
  }    
	
}

function setCookie(name,value)//两个参数，一个是cookie的名子，一个是值
{
    var Days = 30; //此 cookie 将被保存 30 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;

}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
//全屏
 function Fkey(){
     var WsShell = new ActiveXObject('WScript.Shell');
     WsShell.SendKeys('{F11}');
}
function closeWindow(){
	
	window.opener = null;   
	window.open('', '_self', '');   
   	window.close();
}
function Time(){ 
	if (!document.layers&&!document.all) 
	return 
	var Timer=new Date() 
	var hours=Timer.getHours() 
	var minutes=Timer.getMinutes() 
	var seconds=Timer.getSeconds() 
	var noon="AM" 
	if (hours>12){ 
		noon="PM" 
		hours=hours-12 
	} 
	if (hours==0) hours=12 
	if (minutes<=9) minutes="0"+minutes 
	if (seconds<=9) seconds="0"+seconds 
	//这里修改时间的文字样式
	myclock="<font size='7' face='Arial' color=white>"+hours+":"+minutes+":"+seconds+" "+noon+"</b></font>" 
	if (document.layers){ 
		document.layers.position.document.write(myclock) 
		document.layers.position.document.close() 
	} else if (document.all) 
		position.innerHTML=myclock 
		setTimeout("Time()",1000) 
}